
function market8(market_name = '华冠超市') {
    $.post('http://127.0.0.1:5000/data-api/task8', {market_name: market_name}).done(function (data) {
        var myChart = echarts.init(document.querySelector(".rightDown .chart"));
        var option = {
            tooltip: {
                trigger: 'axis'
            },
            grid: {
                left: '3%',
                right: '2%',
                top: '4%',
                bottom: '2%',
                containLabel: true,
            },
            xAxis: [{
                type: 'category',
                data: data['index'],
                axisLine: {
                    lineStyle: {
                        color: "#bbbbbb"
                    }
                },
                axisTick: {show: false}
            }],
            yAxis: [{
                type: 'value',
                max: 6000,
                splitNumber: 5,
                splitLine: {
                    lineStyle: {
                        type: 'dashed',
                        color: '#bbbbbb'
                    }
                },
                axisLine: {
                    show: false,
                    lineStyle: {
                        color: "#d5d5d5"
                    },
                },
                axisLabel: {
                    show: false
                },
                nameTextStyle: {
                    color: "#999"
                },
            }],
            series: [
                {
                    type: 'line',
                    data: data['value'],
                    lineStyle: {
                        normal: {
                            width: 8,
                            color: {
                                type: 'linear',

                                colorStops: [{
                                    offset: 0,
                                    color: 'rgba(139, 200, 243, 1)' // 0% 处的颜色
                                }, {
                                    offset: 1,
                                    color: 'rgba(108, 80, 243, 1)' // 100% 处的颜色
                                }],
                                globalCoord: false // 缺省为 false
                            },
                            shadowColor: 'rgba(72,216,191, 0.3)',
                            shadowBlur: 10,
                            shadowOffsetY: 20
                        }
                    },
                    symbolSize: 10,
                    label: {
                         show: true,
                         position: 'top',
                         lineHeight: 20,
                         borderRadius: 5,
                         backgroundColor: '#ffffff',
                         borderColor: '#ffffff',
                         borderWidth: '1',
                         padding: [5, 8, 4],
                         color: '#000000',
                         fontSize: 14,
                         fontWeight: 'normal',
                     },
                    itemStyle: {
                        normal: {
                            color: '#8095c1',
                        }
                    },
                    smooth: true
                }
            ]
        };
        myChart.setOption(option);
        window.addEventListener("resize", function () {
            myChart.resize();
        });
});
}

// 启动|刷新 浏览器调用
market8();
